<template>
  <div :class="className" :style="{ height: height, width: width }" />
</template>
<script>

import * as echarts from 'echarts'
import 'echarts/extension/bmap/bmap'
// 请确保在引入百度地图扩展之前已经引入百度地图 JS API 脚本并成功加载
// https://api.map.baidu.com/api?v=3.0&ak=你申请的AK

const geoCoordMap = {
  北京: [116.46, 39.92],
  上海: [121.48, 31.22],
  天津: [117.2, 39.13],
  重庆: [106.54, 29.59],
  拉萨: [91.132212, 29.660361],
  阿里地区: [80.105498, 32.503187],
  山南: [91.766529, 29.236023],
  昌都: [97.178452, 31.136875],
  日喀则: [88.885148, 29.267519],
  那曲: [92.060214, 31.476004],
  林芝: [94.362348, 29.654693],

  乌鲁木齐: [87.617733, 43.792818],
  克拉玛依: [84.873946, 45.595886],
  吐鲁番: [89.184078, 42.947613],
  哈密: [93.51316, 42.833248],
  昌吉回族自治州: [87.304012, 44.014577],
  博尔塔拉蒙古自治州: [82.074778, 44.903258],
  巴音郭楞蒙古自治州: [86.150969, 41.768552],
  阿克苏地区: [80.265068, 41.170712],
  克孜勒苏柯尔克孜自治州: [76.172825, 39.713431],
  喀什地区: [75.989138, 39.467664],
  和田地区: [79.92533, 37.110687],
  伊犁哈萨克自治州: [81.317946, 43.92186],
  塔城地区: [82.985732, 46.746301],
  阿勒泰地区: [88.13963, 47.848393],
  石河子: [86.041075, 44.305886],
  阿拉尔: [81.285884, 40.541914],
  图木舒克: [79.077978, 39.867316],
  五家渠: [87.526884, 44.167401],
  北屯: [87.824932, 47.353177],
  铁门关: [85.501218, 41.827251],
  双河: [82.353656, 44.840524],
  可克达拉: [80.63579, 43.6832],
  昆玉: [79.287372, 37.207994],
  胡杨河: [84.8275959, 44.69288853],

  兰州: [103.823557, 36.058039],
  临夏回族自治州: [103.212006, 35.599446],
  金昌: [102.187888, 38.514238],
  张掖: [100.455472, 38.932897],
  酒泉: [98.510795, 39.744023],
  定西: [104.626294, 35.579578],
  甘南藏族自治州: [102.911008, 34.986354],
  白银: [104.173606, 36.54568],
  陇南: [104.929379, 33.388598],
  天水: [105.724998, 34.578529],
  庆阳: [107.638372, 35.734218],
  嘉峪关: [98.277304, 39.786529],
  武威: [102.634697, 37.929996],
  平凉: [106.684691, 35.54279],

  西安: [108.948024, 34.263161],
  汉中: [107.028621, 33.077668],
  咸阳: [108.705117, 34.333439],
  榆林: [109.741193, 38.290162],
  安康: [109.029273, 32.6903],
  延安: [109.49081, 36.596537],
  宝鸡: [107.14487, 34.369315],
  商洛: [109.939776, 33.868319],
  渭南: [109.502882, 34.499381],
  铜川: [108.979608, 34.916582],

  成都: [104.065735, 30.659462],
  自贡: [104.773447, 29.352765],
  攀枝花: [101.716007, 26.580446],
  泸州: [105.443348, 28.889138],
  德阳: [104.398651, 31.127991],
  绵阳: [104.741722, 31.46402],
  广元: [105.829757, 32.433668],
  遂宁: [105.571331, 30.513311],
  内江: [105.066138, 29.58708],
  乐山: [103.761263, 29.582024],
  南充: [106.082974, 30.795281],
  眉山: [103.831788, 30.048318],
  宜宾: [104.630825, 28.760189],
  广安: [106.633369, 30.456398],
  达州: [107.502262, 31.209484],
  雅安: [103.001033, 29.987722],
  巴中: [106.753669, 31.858809],
  资阳: [104.641917, 30.122211],
  阿坝藏族羌族自治州: [102.221374, 31.899792],
  甘孜藏族自治州: [101.963815, 30.050663],
  凉山彝族自治州: [102.258746, 27.886762],

  南宁: [108.320004, 22.82402],
  柳州: [109.411703, 24.314617],
  桂林: [110.299121, 25.274215],
  梧州: [111.297604, 23.474803],
  北海: [109.119254, 21.473343],
  防城港: [108.345478, 21.614631],
  钦州: [108.624175, 21.967127],
  贵港: [109.602146, 23.0936],
  玉林: [110.154393, 22.63136],
  百色: [106.616285, 23.897742],
  贺州: [111.552056, 24.414141],
  河池: [108.062105, 24.695899],
  来宾: [109.229772, 23.733766],
  崇左: [107.353926, 22.404108],

  郑州: [113.665412, 34.757975],
  开封: [114.341447, 34.797049],
  洛阳: [112.434468, 34.663041],
  平顶山: [113.307718, 33.735241],
  安阳: [114.352482, 36.103442],
  鹤壁: [114.295444, 35.748236],
  新乡: [113.883991, 35.302616],
  焦作: [113.238266, 35.23904],
  濮阳: [115.041299, 35.768234],
  许昌: [113.826063, 34.022956],
  漯河: [114.026405, 33.575855],
  三门峡: [111.194099, 34.777338],
  南阳: [112.540918, 32.999082],
  商丘: [115.650497, 34.437054],
  信阳: [114.075031, 32.123274],
  周口: [114.649653, 33.620357],
  驻马店: [114.024736, 32.980169],
  济源: [112.590047, 35.090378],

  // 内蒙古
  赤峰: [118.956806, 42.275317],
  呼伦贝尔: [119.758168, 49.215333],
  兴安盟: [122.070317, 46.076268],
  呼和浩特: [111.670801, 40.818311],
  包头: [109.840405, 40.658168],
  乌海: [106.825563, 39.673734],
  通辽: [122.263119, 43.617429],
  鄂尔多斯: [109.99029, 39.817179],
  巴彦淖尔: [107.416959, 40.757402],
  乌兰察布: [113.114543, 41.034126],
  锡林郭勒盟: [116.090996, 43.944018],
  阿拉善盟: [105.706422, 38.844814],

  // 吉林省
  长春: [125.3245, 43.886841],
  吉林: [126.55302, 43.843577],
  四平: [124.370785, 43.170344],
  辽源: [125.145349, 42.902692],
  通化: [125.936501, 41.721177],
  白山: [126.427839, 41.942505],
  松原: [124.823608, 45.118243],
  白城: [122.841114, 45.619026],
  延边朝鲜族自治州: [129.513228, 42.904823],

  // 浙江省
  杭州: [120.153576, 30.287459],
  宁波: [121.549792, 29.868388],
  温州: [120.672111, 28.000575],
  嘉兴: [120.750865, 30.762653],
  湖州: [120.102398, 30.867198],
  绍兴: [120.582112, 29.997117],
  金华: [119.649506, 29.089524],
  衢州: [118.87263, 28.941708],
  舟山: [122.106863, 30.016028],
  台州: [121.428599, 28.661378],
  丽水: [119.921786, 28.451993],

  // 江西
  南昌: [115.892151, 28.676493],
  景德镇: [117.214664, 29.29256],
  萍乡: [113.852186, 27.622946],
  九江: [115.992811, 29.712034],
  新余: [114.930835, 27.810834],
  鹰潭: [117.033838, 28.238638],
  赣州: [114.940278, 25.85097],
  吉安: [114.986373, 27.111699],
  宜春: [114.391136, 27.8043],
  抚州: [116.358351, 27.98385],
  上饶: [117.971185, 28.44442],

  // 湖北
  武汉: [114.298572, 30.584355],
  黄石: [115.077048, 30.220074],
  十堰: [110.787916, 32.646907],
  宜昌: [111.290843, 30.702636],
  襄阳: [112.144146, 32.042426],
  鄂州: [114.890593, 30.396536],
  荆门: [112.204251, 31.03542],
  孝感: [113.926655, 30.926423],
  荆州: [112.23813, 30.326857],
  黄冈: [114.879365, 30.447711],
  咸宁: [114.328963, 29.832798],
  随州: [113.37377, 31.717497],
  仙桃: [113.453974, 30.364953],
  潜江: [112.896866, 30.421215],
  天门: [113.165862, 30.653061],
  恩施土家族苗族自治州: [109.4869983114],
  神农架林区: [110.671525, 31.74444],

  // 广东
  广州: [113.280637, 23.125178],
  韶关: [113.591544, 24.801322],
  深圳: [114.085947, 22.547],
  珠海: [113.553986, 22.224979],
  汕头: [116.708463, 23.37102],
  佛山: [113.122717, 23.028762],
  江门: [113.094942, 22.590431],
  湛江: [110.364977, 21.274898],
  茂名: [110.919229, 21.659751],
  肇庆: [112.472529, 23.051546],
  惠州: [114.412599, 23.079404],
  梅州: [116.117582, 24.299112],
  汕尾: [115.364238, 22.774485],
  河源: [114.697802, 23.746266],
  阳江: [111.975107, 21.859222],
  清远: [113.051227, 23.685022],
  东莞: [113.746262, 23.046237],
  中山: [113.382391, 22.521113],
  潮州: [116.632301, 23.661701],
  揭阳: [116.355733, 23.543778],
  云浮: [112.044439, 22.929801],

  // 贵州
  贵阳: [106.713478, 26.578343],
  遵义: [106.937265, 27.706626],
  六盘水: [104.846743, 26.584643],
  安顺: [105.932188, 26.245544],
  毕节: [105.28501, 27.301693],
  铜仁: [109.191555, 27.718346],
  黔西南布依族苗族自治州: [104.897971, 25.08812],
  黔东南苗族侗族自治州: [107.977488, 26.583352],
  黔南布依族苗族自治州: [107.517156, 26.258219],

  // 青海
  西宁: [101.778916, 36.623178],
  海东: [102.10327, 36.502916],
  海北藏族自治州: [100.901059, 36.959435],
  黄南藏族自治州: [102.019988, 35.517744],
  海南藏族自治州: [100.619542, 36.280353],
  果洛藏族自治州: [100.242143, 34.4736],
  玉树藏族自治州: [97.008522, 33.004049],
  海西蒙古族藏族自治州: [97.370785, 37.374663],

  // 辽宁
  沈阳: [123.429096, 41.796767],
  大连: [121.618622, 38.91459],
  鞍山: [122.995632, 41.110626],
  抚顺: [123.921109, 41.875956],
  本溪: [123.770519, 41.297909],
  丹东: [124.383044, 40.124296],
  锦州: [121.135742, 41.119269],
  营口: [122.235151, 40.667432],
  阜新: [121.648962, 42.011796],
  辽阳: [123.18152, 41.269402],
  盘锦: [122.06957, 41.124484],
  铁岭: [123.844279, 42.290585],
  朝阳: [120.451176, 41.576758],
  葫芦岛: [120.856394, 40.755572],

  // 江苏
  南京: [118.767413, 32.041544],
  无锡: [120.301663, 31.574729],
  徐州: [117.184811, 34.261792],
  常州: [119.946973, 31.772752],
  南通: [120.864608, 32.016212],
  苏州: [120.619585, 31.299379],
  连云港: [119.178821, 34.600018],
  淮安: [119.021265, 33.597506],
  盐城: [120.139998, 33.377631],
  扬州: [119.421003, 32.393159],
  镇江: [119.452753, 32.204402],
  泰州: [119.915176, 32.484882],
  宿迁: [118.275162, 33.963008],

  // 安徽
  合肥: [117.283042, 31.86119],
  芜湖: [118.376451, 31.326319],
  蚌埠: [117.363228, 32.939667],
  淮南: [117.018329, 32.647574],
  马鞍山: [118.507906, 31.689362],
  淮北: [116.794664, 33.971707],
  铜陵: [117.816576, 30.929935],
  安庆: [117.043551, 30.50883],
  黄山: [118.317325, 29.709239],
  滁州: [118.316264, 32.303627],
  阜阳: [115.819729, 32.896969],
  宿州: [116.984084, 33.633891],
  六安: [116.507676, 31.752889],
  亳州: [115.782939, 33.869338],
  池州: [117.489157, 30.656037],
  宣城: [118.757995, 30.945667],

  // 河北省
  石家庄: [114.48, 38.03],
  唐山: [118.02, 39.63],
  秦皇岛: [119.57, 39.95],
  邯郸: [114.47, 36.6],
  邢台: [114.48, 37.05],
  保定: [115.48, 38.85],
  张家口: [114.87, 40.82],
  承德: [117.93, 40.97],
  沧州: [116.83, 38.33],
  廊坊: [116.7, 39.53],
  衡水: [115.72, 37.72],

  // 山西省
  山西省: [112.53, 37.87],
  太原: [112.53, 37.87],
  大同: [113.3, 40.12],
  阳泉: [113.57, 37.85],
  长治: [113.08, 36.18],
  晋城: [112.83, 35.52],
  朔州: [112.43, 39.33],
  晋中: [112.74, 37.7],
  运城: [110.97, 35.03],
  忻州: [112.73, 38.42],
  临汾: [111.5, 36.08],
  吕梁: [111.13, 37.52],

  // 黑龙江省
  哈尔滨: [126.63, 45.75],
  齐齐哈尔: [123.97, 47.33],
  鹤岗: [130.3, 47.33],
  鸡西: [130.97, 45.3],
  双鸭山: [131.17, 46.65],
  大庆: [125.03, 46.58],
  伊春: [128.92, 47.73],
  佳木斯: [130.35, 46.83],
  七台河: [130.83, 45.82],
  牡丹江: [129.58, 44.6],
  黑河: [127.53, 50.22],
  绥化: [127, 46.63],
  大兴安岭地区: [124.71, 52.34],

  // 福建省
  福州: [119.3, 26.08],
  厦门: [118.1, 24.46],
  莆田: [119, 25.44],
  三明: [117.61, 26.23],
  泉州: [118.58, 24.93],
  漳州: [117.35, 24.52],
  南平: [118.16, 26.65],
  龙岩: [117.01, 25.12],
  宁德: [119.52, 26.65],

  // 山东省
  济南: [117, 36.65],
  青岛: [120.33, 36.07],
  淄博: [118.05, 36.78],
  枣庄: [117.57, 34.86],
  东营: [118.49, 37.46],
  烟台: [121.39, 37.52],
  潍坊: [119.1, 36.62],
  济宁: [116.59, 35.38],
  泰安: [117.13, 36.18],
  威海: [122.1, 37.5],
  日照: [119.46, 35.42],
  临沂: [118.35, 35.05],
  德州: [116.29, 37.45],
  聊城: [115.97, 36.45],
  滨州: [118.03, 37.36],
  菏泽: [115.47, 35.25],

  // 湖南省
  长沙: [113, 28.21],
  株洲: [113.16, 27.83],
  湘潭: [112.91, 27.87],
  衡阳: [112.61, 26.89],
  邵阳: [111.5, 27.22],
  岳阳: [113.09, 29.37],
  常德: [111.69, 29.05],
  张家界: [110.48, 29.13],
  益阳: [112.33, 28.6],
  郴州: [113, 25.79],
  永州: [111.63, 26.22],
  怀化: [109.95, 27.52],
  娄底: [111.96, 27.71],
  湘西土家族苗族自治州: [109.74, 28.31],

  // 海南省
  海口: [110.35, 20.02],
  三亚: [109.51, 18.25],
  三沙: [112.35, 16.83],
  儋州: [109.58, 19.52],
  五指山: [109.52, 18.78],
  琼海: [110.46, 19.25],
  文昌: [110.72, 19.61],
  万宁: [110.39, 18.8],
  东方: [108.64, 19.09],
  定安县: [110.31, 19.68],
  屯昌县: [110.1, 19.36],
  澄迈县: [110, 19.75],
  临高县: [109.69, 19.91],
  白沙黎族自治县: [109.44, 19.23],
  昌江黎族自治县: [109.03, 19.25],
  乐东黎族自治县: [109.17, 18.73],
  陵水黎族自治县: [110.02, 18.48],
  保亭黎族苗族自治县: [109.7, 18.64],
  琼中黎族苗族自治县: [109.83, 19.05],

  // 云南省
  昆明: [102.73, 25.04],
  曲靖: [103.79, 25.51],
  玉溪: [102.52, 24.35],
  保山: [99.17, 25.11],
  昭通: [103.7, 29.32],
  丽江: [100.25, 26.86],
  普洱: [101.03, 23.07],
  临沧: [100.09, 23.89],
  楚雄彝族自治州: [101.54, 25.01],
  红河哈尼族彝族自治州: [102.42, 23.35],
  文山壮族苗族自治州: [104.24, 23.37],
  西双版纳傣族自治州: [100.80, 22.00],
  大理白族自治州: [100.19, 25.69],
  德宏傣族景颇族自治州: [98.58, 24.44],
  怒江傈僳族自治州: [98.85, 25.85],
  迪庆藏族自治州: [99.71, 27.83],

  // 宁夏
  银川: [106.27, 38.47],
  石嘴山: [106.39, 39.04],
  吴忠: [106.21, 37.99],
  固原: [106.28, 36.01],
  中卫: [105.18, 37.51]

}
const convertData = function(data) {
  var res = []
  for (var i = 0; i < data.length; i++) {
    var geoCoord = geoCoordMap[data[i].name]
    if (geoCoord) {
      res.push({
        name: data[i].name,
        value: geoCoord.concat(data[i].value)
      })
    }
  }
  return res
}
export default {

  name: 'MapChart',
  props: {
    className: {
      type: String,
      default: 'chart'
    },
    width: {
      type: String,
      default: '100%'
    },
    height: {
      type: String,
      default: '700px'
    },
    data: {
      type: Array,
      default: []
    }
  },
  data() {
    return {
      chart: null
    }
  },
  mounted() {
    this.$nextTick(() => {
      this.initChart()
    })
  },
  methods: {
    initChart() {
      this.chart = echarts.init(this.$el, 'macarons')
      this.chart.setOption({
        tooltip: {
          trigger: 'item'
        },
        bmap: {
          center: [104.114129, 37.550339],
          zoom: 5,
          roam: true,
          mapStyle: {
            styleJson: [{
              featureType: 'land',
              elementType: 'geometry',
              stylers: {
                color: '#242f3eff'
              }
            }, {
              featureType: 'manmade',
              elementType: 'geometry',
              stylers: {
                color: '#242f3eff'
              }
            }, {
              featureType: 'water',
              elementType: 'geometry',
              stylers: {
                color: '#17263cff'
              }
            }, {
              featureType: 'road',
              elementType: 'geometry.fill',
              stylers: {
                color: '#9e7d60ff'
              }
            }, {
              featureType: 'road',
              elementType: 'geometry.stroke',
              stylers: {
                color: '#554631ff'
              }
            }, {
              featureType: 'districtlabel',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#d69563ff'
              }
            }, {
              featureType: 'districtlabel',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#17263cff',
                'weight': 3
              }
            }, {
              featureType: 'poilabel',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#d69563ff'
              }
            }, {
              featureType: 'poilabel',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#17263cff',
                'weight': 3
              }
            }, {
              featureType: 'subway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'railway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'poilabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'subwaylabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'subwaylabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'tertiarywaysign',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'tertiarywaysign',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'provincialwaysign',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'provincialwaysign',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'nationalwaysign',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'nationalwaysign',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'highwaysign',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'highwaysign',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'green',
              elementType: 'geometry',
              stylers: {
                color: '#263b3eff'
              }
            }, {
              featureType: 'nationalwaysign',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#d0021bff'
              }
            }, {
              featureType: 'nationalwaysign',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#ffffffff'
              }
            }, {
              featureType: 'city',
              elementType: 'labels',
              stylers: {
                visibility: 'on'
              }
            }, {
              featureType: 'city',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'city',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#d69563ff'
              }
            }, {
              featureType: 'city',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#17263cff'
              }
            }, {
              featureType: 'water',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#d69563ff'
              }
            }, {
              featureType: 'water',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#242f3eff'
              }
            }, {
              featureType: 'local',
              elementType: 'geometry.fill',
              stylers: {
                color: '#38414eff'
              }
            }, {
              featureType: 'local',
              elementType: 'geometry.stroke',
              stylers: {
                color: '#ffffff00'
              }
            }, {
              featureType: 'fourlevelway',
              elementType: 'geometry.fill',
              stylers: {
                color: '#38414eff'
              }
            }, {
              featureType: 'fourlevelway',
              elementType: 'geometry.stroke',
              stylers: {
                color: '#ffffff00'
              }
            }, {
              featureType: 'tertiaryway',
              elementType: 'geometry.fill',
              stylers: {
                color: '#38414eff'
              }
            }, {
              featureType: 'tertiaryway',
              elementType: 'geometry.stroke',
              stylers: {
                color: '#ffffff00'
              }
            }, {
              featureType: 'tertiaryway',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#759879ff'
              }
            }, {
              featureType: 'fourlevelway',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#759879ff'
              }
            }, {
              featureType: 'highway',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#759879ff'
              }
            }, {
              featureType: 'highway',
              elementType: 'geometry.fill',
              stylers: {
                color: '#9e7d60ff'
              }
            }, {
              featureType: 'highway',
              elementType: 'geometry.stroke',
              stylers: {
                color: '#554631ff'
              }
            }, {
              featureType: 'provincialway',
              elementType: 'geometry.fill',
              stylers: {
                color: '#9e7d60ff'
              }
            }, {
              featureType: 'provincialway',
              elementType: 'geometry.stroke',
              stylers: {
                color: '#554631ff'
              }
            }, {
              featureType: 'tertiaryway',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#1a2e1cff'
              }
            }, {
              featureType: 'fourlevelway',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#1a2e1cff'
              }
            }, {
              featureType: 'highway',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#1a2e1cff'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#1a2e1cff'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#759879ff'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'geometry.fill',
              stylers: {
                color: '#9e7d60ff'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'geometry.stroke',
              stylers: {
                color: '#554631ff'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'geometry.fill',
              stylers: {
                color: '#9e7d60ff'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'geometry.stroke',
              stylers: {
                color: '#554631ff'
              }
            }, {
              featureType: 'arterial',
              elementType: 'geometry.fill',
              stylers: {
                color: '#9e7d60ff'
              }
            }, {
              featureType: 'arterial',
              elementType: 'geometry.stroke',
              stylers: {
                color: '#554631fa'
              }
            }, {
              featureType: 'medicallabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'medicallabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'entertainmentlabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'entertainmentlabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'estatelabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'estatelabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'businesstowerlabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'businesstowerlabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'companylabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'companylabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'governmentlabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'governmentlabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'restaurantlabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'restaurantlabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'hotellabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'hotellabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'shoppinglabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'shoppinglabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'lifeservicelabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'lifeservicelabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'carservicelabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'carservicelabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'financelabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'financelabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'otherlabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'otherlabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'airportlabel',
              elementType: 'labels',
              stylers: {
                visibility: 'on'
              }
            }, {
              featureType: 'airportlabel',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#d69563ff'
              }
            }, {
              featureType: 'airportlabel',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#17263cff'
              }
            }, {
              featureType: 'airportlabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'highway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '6'
              }
            }, {
              featureType: 'highway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '7'
              }
            }, {
              featureType: 'highway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '8'
              }
            }, {
              featureType: 'highway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '9'
              }
            }, {
              featureType: 'highway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '10'
              }
            }, {
              featureType: 'highway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '6'
              }
            }, {
              featureType: 'highway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '7'
              }
            }, {
              featureType: 'highway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '8'
              }
            }, {
              featureType: 'highway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '9'
              }
            }, {
              featureType: 'highway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '10'
              }
            }, {
              featureType: 'nationalway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '6'
              }
            }, {
              featureType: 'nationalway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '7'
              }
            }, {
              featureType: 'nationalway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '8'
              }
            }, {
              featureType: 'nationalway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '9'
              }
            }, {
              featureType: 'nationalway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '10'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '6'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '7'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '8'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '9'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '10'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '6'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '7'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '8'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '9'
              }
            }, {
              featureType: 'nationalway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '10'
              }
            }, {
              featureType: 'highway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '6'
              }
            }, {
              featureType: 'highway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '7'
              }
            }, {
              featureType: 'highway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '8'
              }
            }, {
              featureType: 'highway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '9'
              }
            }, {
              featureType: 'highway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '10'
              }
            }, {
              featureType: 'provincialway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '8,9',
                'level': '8'
              }
            }, {
              featureType: 'provincialway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '8,9',
                'level': '9'
              }
            }, {
              featureType: 'provincialway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '8,9',
                'level': '8'
              }
            }, {
              featureType: 'provincialway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '8,9',
                'level': '9'
              }
            }, {
              featureType: 'provincialway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '8,9',
                'level': '8'
              }
            }, {
              featureType: 'provincialway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '8,9',
                'level': '9'
              }
            }, {
              featureType: 'cityhighway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '6'
              }
            }, {
              featureType: 'cityhighway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '7'
              }
            }, {
              featureType: 'cityhighway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '8'
              }
            }, {
              featureType: 'cityhighway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '9'
              }
            }, {
              featureType: 'cityhighway',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '10'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '6'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '7'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '8'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '9'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '10'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '6'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '7'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '8'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '9'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '6,10',
                'level': '10'
              }
            }, {
              featureType: 'arterial',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '9,10',
                'level': '9'
              }
            }, {
              featureType: 'arterial',
              stylers: {
                'curZoomRegionId': '0',
                'curZoomRegion': '9,10',
                'level': '10'
              }
            }, {
              featureType: 'arterial',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '9,10',
                'level': '9'
              }
            }, {
              featureType: 'arterial',
              elementType: 'geometry',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '9,10',
                'level': '10'
              }
            }, {
              featureType: 'arterial',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '9,10',
                'level': '9'
              }
            }, {
              featureType: 'arterial',
              elementType: 'labels',
              stylers: {
                visibility: 'off',
                'curZoomRegionId': '0',
                'curZoomRegion': '9,10',
                'level': '10'
              }
            }, {
              featureType: 'building',
              elementType: 'geometry.topfill',
              stylers: {
                color: '#2a3341ff'
              }
            }, {
              featureType: 'building',
              elementType: 'geometry.sidefill',
              stylers: {
                color: '#313b4cff'
              }
            }, {
              featureType: 'building',
              elementType: 'geometry.stroke',
              stylers: {
                color: '#1a212eff'
              }
            }, {
              featureType: 'road',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#759879ff'
              }
            }, {
              featureType: 'road',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#1a2e1cff'
              }
            }, {
              featureType: 'provincialway',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#759879ff'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#759879ff'
              }
            }, {
              featureType: 'arterial',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#759879ff'
              }
            }, {
              featureType: 'provincialway',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#1a2e1cff'
              }
            }, {
              featureType: 'cityhighway',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#1a2e1cff'
              }
            }, {
              featureType: 'arterial',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#1a2e1cff'
              }
            }, {
              featureType: 'local',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'manmade',
              elementType: 'labels.text.fill',
              stylers: {
                color: '#d69563ff'
              }
            }, {
              featureType: 'manmade',
              elementType: 'labels.text.stroke',
              stylers: {
                color: '#17263cff'
              }
            }, {
              featureType: 'subwaystation',
              elementType: 'geometry',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'transportationlabel',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'transportationlabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'estate',
              elementType: 'geometry',
              stylers: {
                color: '#2a3341ff'
              }
            }, {
              featureType: 'poilabel',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'road',
              elementType: 'geometry',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'road',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'island',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'village',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'town',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'town',
              elementType: 'labels.icon',
              stylers: {
                visibility: 'off'
              }
            }, {
              featureType: 'district',
              elementType: 'labels',
              stylers: {
                visibility: 'off'
              }
            }]
          }
        },
        series: [
          {
            name: '地理分布图',
            type: 'scatter',
            coordinateSystem: 'bmap',
            data: convertData(this.data),
            // 圆圈大小
            symbolSize: function(val) {
              if (val[2] < 20) {
                return 10
              } else if (val[2] > 20 && val[2] < 100) {
                return 15
              } else {
                return 25
              }
            },
            encode: {
              value: 2
            },
            label: {
              formatter: '{b}',
              position: 'right',
              show: false
            },
            emphasis: {
              label: {
                show: true
              }
            }
          }

        ]
      })
    }

  }
}
</script>

